package com.fenxiangle.yueding.feature.mine.model;

import com.fenxiangle.yueding.entity.bo.OrderBo;
import com.fenxiangle.yueding.entity.bo.PageBo;
import com.fenxiangle.yueding.entity.bo.PublishDemandBo;
import com.fenxiangle.yueding.entity.bo.TeamBo;
import com.fenxiangle.yueding.feature.mine.contract.TeamContract;
import com.fenxiangle.yueding.feature.mine.dependencies.team.DaggerTeamModelComponent;
import com.fenxiangle.yueding.framework.api.ApiLib;
import com.fenxiangle.yueding.framework.api.UserApi;
import com.suozhang.framework.component.http.RxDataProcessFactory;

import java.util.List;

import javax.inject.Inject;

import io.reactivex.Observable;

public class TeamModel implements TeamContract.Model {

    @Inject
    UserApi api;


    @Inject
    public TeamModel() {
        DaggerTeamModelComponent.builder().apiComponent(ApiLib.apiComponent()).build().inject(this);
    }


    @Override
    public Observable<OrderBo> userStatus(PageBo pageBo) {
        return api.userStatus(pageBo).compose(RxDataProcessFactory.dataPrepAndIoToMainTransformer());
    }

    @Override
    public Observable<OrderBo> submitUser(PageBo pageBo) {
        return api.submitUser(pageBo).compose(RxDataProcessFactory.dataPrepAndIoToMainTransformer());
    }

    @Override
    public Observable<List<TeamBo>> getTeamList(PageBo pageBo) {
        return api.getTeamList(pageBo).compose(RxDataProcessFactory.dataPrepAndIoToMainTransformer());
    }

    @Override
    public Observable<List<TeamBo>> getUserList(PageBo pageBo) {
        return api.getUserList(pageBo).compose(RxDataProcessFactory.dataPrepAndIoToMainTransformer());
    }
}
